﻿#include "PhyscisPropGeneralLaminateWapper.h"
#include "FITK_Kernel/FITKAppFramework/FITKMessage.h"


GeneralLaminate * PhyscisPropGeneralLaminateWapper::new_GeneralLaminate()
{
    return new GeneralLaminate;
}
void PhyscisPropGeneralLaminateWapper::delete_GeneralLaminate(GeneralLaminate * obj)
{
    if (obj) delete obj;
}

GeneralLaminate * PhyscisPropGeneralLaminateWapper::static_GeneralLaminate_GetGeneralLaminate(const QString & name)
{
    return new GeneralLaminate(name);
}

QString PhyscisPropGeneralLaminateWapper::getName(GeneralLaminate * obj)
{
    if (obj)
        return obj->getName();
    return QString();
}

void PhyscisPropGeneralLaminateWapper::setName(GeneralLaminate * obj, const QString & name)
{
    if (!obj)return;
    bool ok = obj->setName(name);
    if (!ok) {
        AppFrame::FITKMessageError("Set Name failed !");
    }
}

void PhyscisPropGeneralLaminateWapper::addLayer(GeneralLaminate* obj, const QString & material, double thickness, double angle, const QString & DLFSpectra)
{
    if (!obj)return;
    bool ok = obj->addLayer(material, thickness, angle, DLFSpectra);
    if (!ok) {
        AppFrame::FITKMessageError("Add Layer failed !");
    }
}

void PhyscisPropGeneralLaminateWapper::insertLayer(GeneralLaminate* obj, int num, const QString & material, double thickness, double angle, const QString & DLFSpectra)
{
    if (!obj)return;
    bool ok = obj->insertLayer(num,material, thickness, angle, DLFSpectra);
    if (!ok) {
        AppFrame::FITKMessageError("Insert Layer failed !");
    }
}

void PhyscisPropGeneralLaminateWapper::deleteLayer(GeneralLaminate* obj, int num)
{
    if (!obj)return;
    bool ok = obj->deleteLayer(num);
    if (!ok) {
        AppFrame::FITKMessageError("Delete Layer failed !");
    }
}

int PhyscisPropGeneralLaminateWapper::getLayerCount(GeneralLaminate* obj )
{
    if (obj)
        return obj->getLayerCount();
    return -1;
}

void PhyscisPropGeneralLaminateWapper::createPhyscisProp(GeneralLaminate * obj, const QString & name)
{
    if (!obj)return;
    bool ok = obj->createPhyscisProp(name);
    if (!ok) {
        AppFrame::FITKMessageError("Create Physcis Property failed !");
    }
}

GeneralLaminate::GeneralLaminate(const QString & name) :
    Acoustics::PyFITKPhyscisPropGeneralLaminate(name)
{
}

GeneralLaminate::GeneralLaminate() :
    Acoustics::PyFITKPhyscisPropGeneralLaminate()
{
}
